package cn.lu.train.broadcast;

import android.app.Notification;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;

import cn.lu.train.R;

public class BoxBroadcastReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        Notification notify = new NotificationCompat.Builder(context, "channel")
                .setSmallIcon(R.mipmap.ic_launcher)
                .setContentTitle("zhangsan")
                .setContentText("hello you are alright")
                .build();

        manager.notify(11, notify);
    }
}
